<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
 
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>

<script type="text/javascript">
    function deleteContendor() {
        if (confirm("Desea eliminar este contendor")) {
            return true;
        }
        return false;
    }
</script>
<div class="container">
    <div class="row"><br><br>
    <h2>Listado de Contendores</h2>
    <h5>Criterios de Busqueda</h5>
    <div class="hero-unit-min">
                <!--div class="clear"></div-->
                <div class="buscar-form">
                <form:form action="buscar" method="post" commandName="criterioBusqueda">
                <table border=0 cellspacing=0 cellpadding=0 width="100%" height="50px" bordercolor=red >
                <tr>
                    <td>Contendor</td>
                    <td><form:input path="nombre" size="10" cssClass="input-large"></form:input>
                    </td>
                    <!---td>
                        <input type="submit" value="Buscar" class="btn btn-mini btn-primary"/>
                    </td-->
                </tr>
		<tr>
                    <td colspan="6" align="right">
                        
                        <input type="submit" value="Buscar" class="btn btn-mini btn-primary"/>
                        <a href="<c:url value='/pages/contendor/new'/>" class="btn btn-mini btn-primary">Nuevo</a>
                    </td>
		</tr>                
                </table>
                </form:form>
                </div>  
     </div>
    </div>
    <br/>
    <table class="table table-hover">
        <tr>
            <th>#</th>
            <th>Contendor</th>
            <th>Tipo</th>
            <th>Imagen</th>
            <th>Texto</th>
            <th>Fecha Registro</th>
            <th>Estado</th>
            <th style="width: 150px;"></th>
            <th style="width: 150px;"></th>
        </tr>
        <c:forEach var="contendor" items="${resultado}">
            <tr>
                <td>${contendor.idcontendor}</td>
                <td>${contendor.nocontendor}</td>
                <td>${contendor.fltipo}</td>
                <td>${contendor.noimagen}</td>
                <td>${contendor.txtexto}</td>
                <td>${contendor.fcregistro}</td>
                <td>${contendor.idestado}</td>
                <td><a href="<c:url value='/pages/contendor/edit?id=${contendor.idcontendor}'/>"><i class="icon-edit"></i></a></td>
                <td><a href="<c:url value='/pages/contendor/delete?id=${contendor.idcontendor}'/>" onclick="if (deleteContendor()) { return true; } else { return false; }"><i class="icon-delete"></i></a></td>
            </tr>
        </c:forEach>
    </table>
</div>

